import {
    GET_SEARCH_DATA,
    LOGIN_TOKEN,
    GET_USER_INFO,
    COMPANY_SEARCH_DATA,
    XINBA_PAY
} from "./types"
import { createAction } from "redux-actions"
import http from "../../util/ajax"

//登录获取token
export const getLoginToken = createAction(LOGIN_TOKEN, params => {
    return http.post({
        url: "/zuul/auth/login",
        params: params
    })
})

//获取用户信息
export const getUserInfo = createAction(GET_USER_INFO, (params = {}) => {
    if (params.clear) {
        return new Promise((resolve, reject) => {
            return resolve({companyId: null,
                password: null,
                phone: null,
                uperUserId: null,
                urlAddr: null,
                userId: null,
                userName: null});
        });
    }else {
        return http.get({
            url: "/receiptapp/userInfo/queryUser",
            params: params
        })
    }
})

